#!/usr/bin/env python
# -*- coding:utf-8 -*-
from bs4 import BeautifulSoup
if __name__ == "__main__":
    # 将本地的html文档中的数据加载到该对象中
    fp = open('./data/test.html', 'r', encoding='utf-8')
    soup = BeautifulSoup(fp, 'lxml')
    # soup.tagName 返回的是第一次出现的tagName标签
    print(soup.h1)
    # soup.find(tagName) 等同于 soup.tagName
    print(soup.find('div', class_='song'))

    # soup.find_all(tagName) 返回数组
    print(soup.find_all('p'))
    # soup.select('.song') 返回数组
    print(soup.select('.song'))